﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using PersonalWebsite.Domain.Abstract.Configuration;
using PersonalWebsite.Domain.Entities.Website;

namespace PersonalWebsite.Domain.Configurations.Website;

public class WS_GameVideoConfiguration : BaseConfiguration<WS_GameVideo>
{
    public override void Configure(EntityTypeBuilder<WS_GameVideo> builder)
    {
        builder.ToTable(nameof(WS_GameVideo));

        builder.Property(c => c.Name).HasComment(comment: "名称").IsRequired().HasMaxLength(20);
        builder.HasIndex(c => c.Name).IsUnique();

        builder.Property(c => c.VideoLink).IsUnicode(false).IsRequired(true).HasComment("CG链接").HasMaxLength(1000);

        base.Configure(builder);
    }
}
